﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GluePathModule
{
    public class GluePathUnit
    {
        public List<GluePathItemBase> listContinueItems;
        
        
        public string Name;
        public string strRemark;
        public DrawMode drawMode;

        [Category("单元原点设定")]
        public double StandardLocalX
        {
            get;
            set;
        }
        [Category("单元原点设定")]
        public double StandardLocalY
        {
            get;
            set;
        }
        [Category("单元原点设定")]
        public double StandardLocalZ
        {
            get;
            set;
        }
        [Category("单元原点设定")]
        public double StandardLocalU
        {
            get;
            set;
        }

        [Category("单元原点设定")]
        public double CurrentLocalX
        {
            get;
            set;
        }
        [Category("单元原点设定")]
        public double CurrentLocalY
        {
            get;
            set;
        }
        [Category("单元原点设定")]
        public double CurrentLocalZ
        {
            get;
            set;
        }
        [Category("单元原点设定")]
        public double CurrentLocalU
        {
            get;
            set;
        }
        [Category("单元工具设定")]
        public double CurrentToolX
        {
            get;
            set;
        }
        [Category("单元工具设定")]
        public double CurrentToolY
        {
            get;
            set;
        }
        [Category("单元工具设定")]
        public double CurrentToolZ
        {
            get;
            set;
        }
        [Category("单元工具设定")]
        public double CurrentToolU
        {
            get;
            set;
        }
        [Category("全局设定"), DefaultValue(10.0)]
        public double 全局涂胶速度
        {
            get;
            set;
        }
        
        [Category("全局设定"), DefaultValue(10.0)]
        public double 全局Z高速速度
        {
            get;
            set;
        }
        [Category("全局设定"), DefaultValue(10.0),Browsable(false)]
        public double 全局Z低速速度
        {
            get;
            set;
        }
        [Category("全局设定"), DefaultValue(10.0)]
        public double 全局XY高速速度
        {
            get;
            set;
        }
        [Category("全局设定"), DefaultValue(10.0),Browsable(false)]
        public double 全局XY低速速度
        {
            get;
            set;
        }
        [Category("全局设定"), DefaultValue(0)]
        public double 全局安全高度Z
        {
            get;
            set;
        }
        [Category("全局设定"), DefaultValue(0),Browsable(false)]
        public double 全局安全角度U
        {
            get;
            set;
        }
        [Category("全局设定"), DefaultValue(0),Browsable(false)]
        public double 全局安全角度V
        {
            get;
            set;
        }
        [Category("全局设定"), DefaultValue(0),Browsable(false)]
        public double 全局安全角度W
        {
            get;
            set;
        }
        [Category("全局设定"), DefaultValue(0)]
        public double 全局加速度
        {
            get;
            set;
        }
        [Category("全局设定"), DefaultValue(0)]
        public double 全局减速度
        {
            get;
            set;
        }
        [Category("全局设定"), DefaultValue(0)]
        public double 全局开始速度
        {
            get;
            set;
        }
        [Category("全局设定"), DefaultValue(0)]
        public double 全局结束速度
        {
            get;
            set;
        }
        [Category("全局设定"), DefaultValue(0),Browsable(false)]
        public double BeforeItemU
        {
            get;
            set;
        }
        public GluePathUnit()
        {
            Name = "";
            strRemark = "";
            listContinueItems = new List<GluePathItemBase>();
        }
        public GluePathUnit CopyUnit()
        {
            GluePathUnit newUnit = (GluePathUnit)MemberwiseClone();
            newUnit.listContinueItems = new List<GluePathItemBase>();
            for (int i = 0; i < listContinueItems.Count; i++)
            {
                newUnit.listContinueItems.Add(listContinueItems[i].CopyItem());
            }
            return newUnit;


        }
        public GluePathUnit PasteUnit()
        {
            GluePathUnit newUnit = (GluePathUnit)MemberwiseClone();
            newUnit.listContinueItems = new List<GluePathItemBase>();
            for (int i = 0; i < listContinueItems.Count; i++)
            {
                newUnit.listContinueItems.Add(listContinueItems[i].CopyItem());
            }
            return newUnit;


        }
        public void ShowSettingForm(Panel panel)
        {
            
        }
        public bool LocalHousing(double dOrgX, double dOrgY, double dOrgU)
        {
            CurrentLocalX = dOrgX;
            CurrentLocalY = dOrgY;
            CurrentLocalZ = dOrgU;
          
            return true;


        }
    }
}
